﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting.Contexts;

namespace BrightFrame.Aop
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public sealed class ConnectionAttribute : ContextAttribute, IContributeObjectSink
    {
        public ConnectionAttribute() : base ("Connection")
        {
        }

        public System.Runtime.Remoting.Messaging.IMessageSink GetObjectSink(MarshalByRefObject obj, System.Runtime.Remoting.Messaging.IMessageSink nextSink)
        {
            return new TransactionAop(nextSink);
        }
    }
}
